<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.sfilyh.util.DBUtil" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	request.setAttribute("nav", 4);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css"  href="<%=request.getContextPath()%>/css/cssbase.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/admin.css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/ueditor/themes/default/ueditor.css"/>
<script type="text/javascript">
	window.UEDITOR_HOME_URL = "<%=request.getContextPath()%>/js/ueditor/";
</script>
</head>
<body>
<div class="header"></div>
<div class="content">
	<div class="left">
    	<h3 class="left_menu_title">操作菜单</h3>
        <jsp:include page="/WEB-INF/views/admin/left.jsp" />
    </div>
	<div class="right">
        <form action="<%=request.getContextPath()%>/bz-admin/addCategory" method="post">
        <div class="right_body">        
		<input type="hidden" name="dotype" value="${doType}" />
		<c:if test="${doType == 'update'}">
		<input type="hidden" name="id" value="${category.id}" />	
		</c:if>
		<c:if test="${category.type == 2}">		
		<input type="hidden" name="article" value="${article.id}" />
		</c:if>
		
            <div class="form_item">
                <div class="item_title">名称：</div>
                <div class="item_content">
                    <input type="text" class="input_txt" style="width:200px;" name="cname" value="${category.cname}"/>
                </div>
            </div>
            
            <c:if test="${doType != 'update'}">
	            <div class="form_item">
	                <div class="item_title">类型：</div>
	                <div class="item_content">
	                    <!--
	                    <label for="c_index"><input id="c_index" type="radio" name="c" />首页</label>-->
	                    <label for="c_category"><input id="c_category" type="radio" name="type" value="0" checked="checked" />分类</label>
	                    <label for="c_page"><input id="c_page" type="radio" name="type" value="2" />页面</label>                    
	                </div>
	            </div>
            </c:if>
             
            <c:if test="${doType == 'add' || category.type == 2}">            
            <div class="form_item" <c:if test="${doType == 'add'}">style="display: none;"</c:if> id="page">
                <div class="item_title">内容：</div>
                <div class="item_content" style="height: auto;">
                    <textarea id="myEditor"  name="content" style="width:500px;">${article.content}</textarea>
                </div>
            </div>
            </c:if>
            
            <div class="form_item">
                <div class="item_title"></div>
                <div class="item_content">
                    <input type="submit"  value="保存" class="input_btn"/>
                	<input type="button"  value="取消" class="input_btn"/>
                </div>
            </div>
                        
        </div>
        </form>              
    </div>
    
</div>
</body>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/ueditor/editor_all_min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/ueditor/editor_config.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	
	$('input[name=type]').change(function(){
		if($(this).val() == '2'){			
			$('#page').show();			
		}else{
			$('#page').hide();
		}
	});
	
	var editor = new baidu.editor.ui.Editor();	
	editor.render("myEditor");	
    editor.sync(); 
});
</script>

</html>
